<?php

namespace yak\layui\widgets\grid;

use yii\grid\Column;
use yii\helpers\ArrayHelper;

class LayuiCheckColumn extends Column implements LayuiColInterface
{
    /**
     * @var array
     */
    public $defaultColOptions = [
        'fixed' => 'left'
    ];

    /**
     * @var string
     * checkbox | radio
     */
    public $type = 'checkbox';

    public function renderDataCell($model, $key, $index)
    {
        return "";
    }

    public function generateCol(): array
    {
        // TODO: Implement generateCol() method.
        $colOptions = ArrayHelper::getValue($this->options,
            'colOptions', $this->defaultColOptions);
        $colOptions['type'] = $this->type;
        return $colOptions;
    }

    public function getLabel(): string
    {
        // TODO: Implement getLabel() method.
        return '';
    }
}